#include <iostream>
#include <vector>
using namespace std;

class Date {
public:
    Date(int a, int b, int c)
        : _year(a)
        , _month(b)
        , _day(c)
    {}

    int DateToDays() {
        int y = _year, m = _month, dd = _day;
        int days = dd;
        static const int Month[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        for (int i = 1; i < m; i++) {
            days += Month[i];
            if (i == 2 && ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)))
                days++;
        }
        for (int i = 1; i < y; i++) {
            days += ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)) ? 366 : 365;
        }
        return days;
    }

private:
    int _year;
    int _month;
    int _day;
};
int main() {

    int year1, month1, day1;
    int year2, month2, day2;
    scanf("%4d%2d%2d", &year1, &month1, &day1);
    scanf("%4d%2d%2d", &year2, &month2, &day2);

    Date d1(year1, month1, day1);
    Date d2(year2, month2, day2);

    int count = abs(d1.DateToDays() - d2.DateToDays()) + 1;

    cout << count << endl;

}